home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#47 (Aug 89)
/
PREC Code
/
TEConvert.p
< prev
Wrap
Text File
|
1989-06-10
|
763b
|
31 lines
unit TEConvert;
{General utilities for conversion between TextEdit and strings}
{ see Macintosh Technical note #18 }
interface
{ uses}
{ MemTypes, QuickDraw, OSIntf, ToolIntf;}
procedure TERecToStr (hTE: TEHandle; var str: Str255);
{TERecToStr converts the TextEdit record hTE to the string str.}
{If necessary, the text will be truncated to 255 characters.}
procedure StrToTERec (str: Str255; hTE: TEHandle);
{StrToTERec converts the string str to the TextEdit record hTE. }
implementation
procedure TERecToStr (hTE: TEHandle; var str: Str255);
begin
GetIText(hTE^^.hText, str);
end;
procedure StrToTERec (str: Str255; hTE: TEHandle);
begin
TESetText(POINTER(ORD4(@str) + 1), ORD4(length(str)), hTE);
end;
end.